package org.example.model;

import java.util.List;

/**
 * 组件流程
 */
public class ComponentFlow {

    /**
     * 流程中的组件
     */
    private List<Component> components;

    /**
     * 启动流程，让components中的组件执行
     */
    public <T> void start(T t) {
        components.forEach(e -> e.process(t));
    }

    public List<Component> getComponents() {
        return components;
    }

    public void setComponents(List<Component> components) {
        this.components = components;
    }
}
